package org.Vancl.servlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.Vancl.Dao.ShoppingColorDao;
import org.Vancl.Dao.ImpI.ShoppingColorDaoImpI;
import org.Vancl.entity.shoppingcolor;

@WebServlet(urlPatterns="/updatespxq.shtml")
public class updatespxqservlet extends HttpServlet {
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		req.setCharacterEncoding("utf-8");
		String daid=req.getParameter("daid");
		String daname=req.getParameter("name");
		String id=req.getParameter("id");
		ShoppingColorDao scd=new ShoppingColorDaoImpI();
		shoppingcolor sc=scd.getid(Integer.parseInt(id)); 
		req.setAttribute("sc", sc);
		req.setAttribute("daid", daid);
		req.setAttribute("daname", daname);
		
		req.getRequestDispatcher("HT/HTupdatespxq.jsp").forward(req, resp);
	}
	
	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		this.doGet(req, resp);
	}
}
